package com.aidex.biz.service.impl;

import com.aidex.biz.domain.CustomerFilter;
import com.aidex.biz.mapper.CustomerFilterMapper;
import com.aidex.biz.service.CustomerFilterService;
import com.aidex.common.annotation.DataScope;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.utils.NumberUtils;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 筛选客户条件Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-06-17
 */
@Service
@Transactional(readOnly = true)
public class CustomerFilterServiceImpl extends BaseServiceImpl<CustomerFilterMapper, CustomerFilter> implements CustomerFilterService
{
    private static final Logger log = LoggerFactory.getLogger(CustomerFilterServiceImpl.class);

    /**
     * 获取单条数据
     * @param customerFilter 筛选客户条件
     * @return 筛选客户条件
     */
    @Override
    public CustomerFilter get(CustomerFilter customerFilter)
    {
        CustomerFilter dto = super.get(customerFilter);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 筛选客户条件id
     * @return 筛选客户条件
     */
    @Override
    public CustomerFilter get(String id)
    {
        CustomerFilter dto = super.get(id);
        return dto;
    }


    /**
     * 查询筛选客户条件列表
     * @param customerFilter 筛选客户条件
     * @return 筛选客户条件
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<CustomerFilter> findList(CustomerFilter customerFilter)
    {
        return super.findList(customerFilter);
    }

    /**
     * 分页查询筛选客户条件列表
     * @param customerFilter 筛选客户条件
     * @return 筛选客户条件
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<CustomerFilter> findPage(CustomerFilter customerFilter)
    {
        return super.findPage(customerFilter);
    }

    /**
     * 保存筛选客户条件
     * @param customerFilter
     * @return 结果
     */
    @Override
    public boolean save(CustomerFilter customerFilter)
    {
        return super.save(customerFilter);
    }


    /**
     * 删除筛选客户条件信息
     * @param customerFilter
     * @return 结果
     */
    @Override
    public boolean remove(CustomerFilter customerFilter)
    {
        return super.remove(customerFilter);
    }

    /**
     * 批量删除筛选客户条件
     * @param ids 需要删除的筛选客户条件ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteCustomerFilterByIds(String[] ids)
    {
        return mapper.deleteCustomerFilterByIds(ids);
    }

    /**
     * 获取最大编号
     * @param customerFilter 筛选客户条件
     * @return 结果
     */
    @Override
    public int findMaxSort(CustomerFilter customerFilter)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(customerFilter));
    }
}
